package createType.prototype.example;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import createType.prototype.example.grafic.Command;
import createType.prototype.example.grafic.Toolbar;
import createType.prototype.example.resume.ConcreteResume1;
import createType.prototype.example.resume.PersonalInformation;
import createType.prototype.example.resume.WorkExperience;

public class test {

	@Test
	public void test() {
		fail("Not yet implemented");
	}
	
	@Test
	public void testResume(){
		PersonalInformation p = new PersonalInformation("L","20","femal");
		WorkExperience w1 = new WorkExperience("Goog","2000-2005");
		WorkExperience w2 = new WorkExperience("App","2006-2013");
		List<WorkExperience> wl = new ArrayList<WorkExperience>();
		wl.add(w1);
		wl.add(w2);
		try {
			ConcreteResume1 a = new ConcreteResume1(p,wl);
			ConcreteResume1 b = (ConcreteResume1) a.Clone();
			ConcreteResume1 c = (ConcreteResume1) a.Clone();
			ConcreteResume1 d = a;
			//三个内存位置
			if(a == d){
				System.out.println("true");
			}else{
				System.out.println("false");
			}
			System.out.println(a+" "+b+" "+c+""+d);
			b.print();
			c.print();
		} catch (CloneNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	@Test
	public void testGerific(){
		Toolbar tb = new Toolbar();
	    Command c=(Command)tb.getClone("circle");
	    c.draw();
	    c=(Command)tb.getClone("rectangle");
	     c.draw();
	}

}
